unit FrmMain;

interface

uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
  Vcl.Buttons, ServerContainerUnit1;

type
  TForm2 = class(TForm)
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.SpeedButton1Click(Sender: TObject);
begin
  ServerContainerUnit1.ServerContainer1.IocpDataSnapTransport1.Start;
  Self.SpeedButton1.Enabled := not ServerContainerUnit1.ServerContainer1.IocpDataSnapTransport1.Server.Started;
  Self.SpeedButton2.Enabled := not Self.SpeedButton1.Enabled;
end;

procedure TForm2.SpeedButton2Click(Sender: TObject);
begin
  ServerContainerUnit1.ServerContainer1.IocpDataSnapTransport1.Stop;
  Self.SpeedButton1.Enabled := not ServerContainerUnit1.ServerContainer1.IocpDataSnapTransport1.Server.Started;
  Self.SpeedButton2.Enabled := not Self.SpeedButton1.Enabled;
end;

end.

